@extends('admin.container')

@section('c-body')
    <div class="am-g">
        <div class="am-u-md-12">
            <form class="am-form am-form-horizontal" method="post" action="{{route('admin.site-setting.index')}}" enctype="multipart/form-data">
                {!! csrf_field() !!}
                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">站点欢迎语</label>
                    <div class="am-u-sm-9">
                        <input type="text" id="user-name" placeholder="站点名称" name="name" value="{{ $setting->name }}">
                        <small>将显示在前台顶部欢迎信息等位置</small>
                    </div>
                </div>
                <div class="am-form-group am-form-file">
                    <label for="user-name" class="am-u-sm-3 am-form-label">网站logo</label>
                    <div class="am-u-sm-3">
                        <button type="button" class="am-btn am-btn-default am-btn-sm">
                            <i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
                        <input type="file" name="logo" id="logo">
                    </div>
                    <div class="am-fl" id="file-list-web_logo"></div>
                </div>
                {{--<div class="am-form-group am-form-file">
                    <label for="user-name" class="am-u-sm-3 am-form-label">会员中心Logo</label>
                    <div class="am-u-sm-3">
                        <button type="button" class="am-btn am-btn-default am-btn-sm">
                            <i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
                        <input type="file" name="member-logo" id="member_logo">
                    </div>
                    <div class="am-fl" id="file-list-member_logo"></div>
                </div>
                <div class="am-form-group am-form-file">
                    <label for="user-name" class="am-u-sm-3 am-form-label">商家中心Logo</label>
                    <div class="am-u-sm-3">
                        <button type="button" class="am-btn am-btn-default am-btn-sm">
                            <i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
                        <input id="business_logo" name="business-logo" type="file">
                    </div>
                    <div class="am-fl" id="file-list-business_logo"></div>
                </div>--}}
                <div class="am-u-sm-9 am-u-sm-push-3">
                    <button type="submit" class="am-btn am-btn-primary am-radius">保存修改</button>
                </div>
            </form>
        </div>
    </div>
@stop

@section('c-foot')
    <script>
        $(function() {
            $('#business_logo').on('change', function() {
                var fileNames = '';
                $.each(this.files, function() {
                    fileNames += '<span class="am-badge">' + this.name + '</span> ';
                });
                $('#file-list-business_logo').html(fileNames);
            });
            $('#member_logo').on('change', function() {
                var fileNames = '';
                $.each(this.files, function() {
                    fileNames += '<span class="am-badge">' + this.name + '</span> ';
                });
                $('#file-list-member_logo').html(fileNames);
            });
            $('#web_logo').on('change', function() {
                var fileNames = '';
                $.each(this.files, function() {
                    fileNames += '<span class="am-badge">' + this.name + '</span> ';
                });
                $('#file-list-web_logo').html(fileNames);
            });
        });
    </script>
@stop